const WebpackMerge = require("webpack-merge");

const dev = require("./build/webpack.dev.config.js");
const pro = require("./build/webpack.pro.config.js");
const test = require("./build/webpack.test.config.js");
const dll = require("./build/webpack.dll.config");
module.exports = function (env,argv) {
    let ext = null;
    if(process.env.NODE_ENV=="development"){
        console.log("开发环境");
        ext = dev;
    }
    if(process.env.NODE_ENV=="production"){
        console.log("生产环境");
        ext = pro;
    }
    if(process.env.NODE_ENV=="test"){
        console.log("测试环境");
        ext=test;
    }
    if(process.env.NODE_ENV=="dll"){
        console.log("动态链接库环境");
        return dll;
    }else{
        const base = require("./build/webpack.base.config.js");
        return WebpackMerge.merge(base,ext);
    }
}